package com.huabo.system.oracle.mapper;

import java.math.BigDecimal;

import com.huabo.system.oracle.entity.TblAcquisitionRecord;
import com.hbfk.util.PageInfo;

public class TblAcquisitionRecordMapperSqlConfig {

	
	public String selectListByPageInfo(PageInfo<TblAcquisitionRecord> pageInfo, BigDecimal orgid) {


		StringBuffer sqlSb = new StringBuffer("SELECT * FROM (SELECT BUDGET.*,ROWNUM RN FROM (SELECT RECORDID,RECORDYEAR,RECORDSTART,RECORDEND,RECORDTIME,F.REALNAME,O.ORGNAME,R.RETYPE FROM TBL_ACQUISITION_RECORD R LEFT JOIN TBL_STAFF F ON R.STAFFID = F.STAFFID LEFT JOIN TBL_ORGANIZATION O ON R.ORGID = O.ORGID WHERE R.ORGID =" +orgid);
		sqlSb.append(" ORDER BY R.RECORDSTART DESC ) BUDGET WHERE rownum <= "+(pageInfo.getCurrentPage()*pageInfo.getPageSize())+" ) WHERE RN > "+pageInfo.getCurrentRecord());
		String sql = sqlSb.toString();
		return sql;




	}
}
